<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ page import="java.text.*" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Arrays" %>

<%@ page import="java.util.Hashtable"%>
    
 <%
 
 response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 
 response.setHeader("Pragma","no-cache"); //HTTP 1.0 
 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
	
 UserInfo user = null;
 
 
	if(session.getAttribute("userInfo")==null){
		response.sendRedirect(application.getInitParameter("loginUrl"));
		return;
	}else{
		
		
		
		user = (UserInfo)session.getAttribute("userInfo");
		
		if("18".equals(user.getLoginType())){
			out.println("<script type='text/javascript'>");
			out.println("alert('尊敬的客户,很抱歉,暂不支持随机码登陆方式的用户订购增值业务');");
			out.println("window.history.go(-1)");
			out.println("</script>");
			return;
		}
		if(!("50".equals(user.getLoginType()))&&user.getLinkedAccnbr().size()==0){
			out.println("<script type='text/javascript'>");
			out.println("alert('尊敬的客户,很抱歉,你当前登陆的号码下还未绑定手机号码');");
			out.println("window.history.go(-1)");
			out.println("</script>");
			return;
		}
	}
	
	
	
 	String productid = request.getParameter("productId");
 	String businame = request.getParameter("businame");
 	String fee = request.getParameter("fee");
 	String action = request.getParameter("actionUrl");
 	String orderMode = request.getParameter("orderMode");
 
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="com.doone.telmarket.domain.UserInfo"%>
<%@page import="java.util.List"%><html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>电信应用超市 - 语音及短信增值业务</title>
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath}/css/style_link.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath}/css/tab.css" rel="stylesheet" type="text/css" />
    <SCRIPT src="${pageContext.request.contextPath}/js/tab.js" type=text/javascript></SCRIPT>
    <script src="${pageContext.request.contextPath}/js/jquery.js"
	type="text/javascript"></script>
    
    <script type="text/javascript">
    
    
    	function commit(){
	    	var form = document.getElementById("fom");
	    	form.submit();
    	}

    	function showAcc(id){
    		 document.getElementById("bgLayer").width = document.body.scrollWidth; 
    		 document.all["bgLayer"].style.display="";
    		 document.all["bgLayer"].style.height=document.body.scrollHeight;
    		 document.getElementById(id).style.display="";
    		 timer=setInterval(moveAcc,"100");
    	}
    	function hideAcc(){
    		clearInterval(timer);
    		document.all["bgLayer"].style.display="none";
    		document.all["Layer4"].style.display="none";
    	}
    	function moveAcc(){
    		document.all["Layer4"].style.top=document.body.scrollTop+(document.body.clientHeight-200)/2;
    		document.all["Layer4"].style.left=document.body.scrollLeft+document.body.clientWidth/2-150;
    	}
    	function displayAcc(event){
    	 document.getElementById(event).style.display = "none";
    	 hideFlashUpload();
    	}
    	function selectNbr(){
    		document.getElementById("Layer4").style.display = "";
    		var top = (document.body.clientHeight-200)/2+"px";
    		var left = (document.body.clientWidth-460)/2+80+"px";
    		var div = document.getElementById("Layer4");
    		div.style.top = top;
    		div.style.left = left;
    		showAcc("Layer4");
        }

		function submitForm(){
			var accessNumber = $("#selectNbr").val();
			$("#accessNumber").val(accessNumber);
			document.getElementById("fom").submit();
		}
        
    </script>
<style type="text/css">
<!--
.baibai {
	color: #FFF;
}
-->
</style>
</head>

<body>
<div style="z-index: 1;height: 1000">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
    <iframe src="${pageContext.request.contextPath}/web/common/head.jsp" width="100%" height="267" scrolling="No" frameborder="0"></iframe></td>
  </tr>
</table>
<table width="779" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-bottom:10px;">
  <tr>
    <td><form action="${pageContext.request.contextPath}/web/<%=action %>" id="fom" method="post">
    <input type="hidden" name="productid" id="productid" value="<%=productid %>">
    <input type="hidden" name="businame" id="businame" value="<%=businame %>">
    <input type="hidden" name="fee" id="fee" value="<%=fee %>">
    <input type="hidden" name="orderMode" id="orderMode" value="<%=orderMode %>">
    <input type="hidden" name="accessNumber" id="accessNumber"></form>
    
    <img src="${pageContext.request.contextPath}/images/ts/ssm.jpg" width="779" height="55" border="0" /></td>
  </tr>
  <tr>
    <td><img src="${pageContext.request.contextPath}/images/ts/ss2.jpg" width="779" height="53" border="0" /></td>
  </tr>
  <tr>
    <td height="240" align="center" valign="top" style="background: url(${pageContext.request.contextPath}/images/ts/sds.jpg) bottom no-repeat center; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC;"><table width="470" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="${pageContext.request.contextPath}/images/ts/neik_01.gif" width="470" height="18" border="0" /></td>
      </tr>
      <tr>
        <td height="105" align="center" valign="top" background="${pageContext.request.contextPath}/images/ts/neik_02.gif">
        
        
        <table width="93%" height="65" border="0" cellpadding="0" cellspacing="0" style="margin-top:18px;">
          <tr>
            <td width="143" align="right" valign="middle">
            
            <img src="${pageContext.request.contextPath}/images/ts/tanh.jpg" width="52" height="52" border="0" /> </td>
            <td width="19">&nbsp;</td>
            <td width="275" align="left" valign="middle"><p>
              你确定<%
            	if("buyValueAdded".equals(action)){
            		%>订购<%
            	}else{
            		%>退订<%
            	}
            %>"<%=businame %>(<%=fee %>)"业务吗?
              <%
            	if("buyValueAdded".equals(action)){
            		%>
            		 确认订购请点击"开通"按钮,放弃订购请点击"返回"按钮
            		<%
            	}else{
            		%>
            		 确认退订请点击"确认退订"按钮,放弃退订请点击"返回"按钮
            		<%
            	}
            %><br />
             <span class="hy1"></span><br />
              </p></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><img src="${pageContext.request.contextPath}/images/ts/neik_03.gif" width="470" height="17" border="0" /></td>
      </tr>
    </table>
      <table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="27px"></td>
        </tr>
        <tr>
          <td align="center">
          
           <%
            	if("buyValueAdded".equals(action)){
            		%>
            		  <img src="${pageContext.request.contextPath}/images/ts/an-kt.jpg" style="cursor: hand" width="92" height="31"  onclick="selectNbr();" border="0" id="kt"/>
            		<%
            	}else{
            		%>
            		  <img src="${pageContext.request.contextPath}/images/qrtd.jpg" style="cursor: hand" width="92" height="31" border="0" onclick="selectNbr();" id="kt1"/>
            		<%
            	}
            %>
         
          
          <img src="${pageContext.request.contextPath}/images/ts/an-h.jpg" width="92" style="cursor: hand" height="31" border="0" onclick="window.history.go(-1);" id="qx"/></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td><img src="${pageContext.request.contextPath}/images/ts/ts1.jpg" width="779" height="4" border="0" /></td>
  </tr>
</table>


<table width="986" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="center"><iframe src="${pageContext.request.contextPath}/web/common/footer.html" width="986" height="159" scrolling="No" frameborder="0"></iframe></td>
  </tr>
</table></div>

<div id="bgLayer" style="float:left;position:absolute;background:#CCCCCC;left:0px;top:0px;width:100%;height:1000;filter:alpha(style=0,opacity=50);display:none;z-index:2;"></div>
<div id="Layer4"  style=" display:none; border:0;background-image: url(/images/tck.jpg);position:absolute;top:1px; left:1px; width:528px; height:70px; z-index:3; text-align:left" >

  <div style="width: 298px;background-color: white;height: 212px;background-image: url('${pageContext.request.contextPath}/images/tck.jpg')">
  
  	<div style="margin-top: 60px">
  	<table style="margin-top: 100px">
  		<tr>
  			<td width="85"></td><td>
		  			<select id="selectNbr">
		  		<%
		  			if("50".equals(user.getLoginType())){
		  				%>
		  				<option value="<%=user.getAccnbr() %>"><%=user.getAccnbr() %></option>
		  				<%
		  			}else{
		  				List<String> linkedNbr = user.getLinkedAccnbr();
		  				for(int i=0;i<linkedNbr.size();i++){
		  					%>
		  	  			<option value="<%=linkedNbr.get(i) %>"><%=linkedNbr.get(i) %></option>
		  	  				<%
		  				}
		  			}
		  		%>
		  		</select>
  			</td>
  		</tr><tr height="15"></tr>
  	</table>
  	<img style="margin-left: 80px;cursor: hand" src="${pageContext.request.contextPath}/images/btn_qd.jpg"  onclick="submitForm();" />
  	<img src="${pageContext.request.contextPath}/images/btn_qx.jpg" style="cursor: hand"  onclick="hideAcc();"/>
  		</div>
  </div>
</div>
</body>
</html>